package bfgca;
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;

public class VesselTableModel extends AbstractTableModel{
  private String [] vesselColumns = {"Name", "Type", "Class", "Commander",
      "Location"};
  private ArrayList<Object[]> vesselEntries = new ArrayList<Object[]>();
  
  public String getColumnName(int col){
    return vesselColumns[col].toString();
  }
  public int getRowCount(){
    return vesselEntries.size();
  }
  public int getColumnCount(){
    return vesselColumns.length;
  }
  public Object getValueAt( int row, int column){
    return vesselEntries.get(row)[column];
  }
  public boolean isCellEditable( int row, int column){
    return false;
  }
  private void populateTable(){
    //TODO read data from .json file
    vesselEntries.add(new Object[]{"Entry1", "Entry2", "Entry3", "Entry4", 
        "Entry5"});
  }
  public VesselTableModel(){
    populateTable();
  }

}
